package biz.ezcom.spring.aop.client;


import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import biz.ezcom.spring.aop.service.UserService;

public class Client {
	private static AbstractApplicationContext ctx;
	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
		ctx = new ClassPathXmlApplicationContext("applicationContext-bean.xml"); 
	}

	@Test
	public void testAop(){
		UserService userService = (UserService) ctx.getBean("userService");
		System.out.println("==================================================");
		userService.save();
		System.out.println("==================================================");
		userService.saveException();
	}
	
	@AfterClass
	public static void tearDownAfterClass() throws Exception {
		ctx.close();
	}

}
